//
//  SearchViewController.swift
//  HHSwift
//
//  Created by 华宏 on 2020/2/4.
//  Copyright © 2020 huahong. All rights reserved.
//

import UIKit

class SearchViewController: UIViewController,QKSearchViewDelegate  {

    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = .groupTableViewBackground
        title = "搜索"
        
        let searchView = QKSearchView.init(frame: CGRect.init(x: 50, y: 100, width: self.view.width - 100, height: 50))
        searchView.placeholder = "请输入搜索内容"
        searchView.delegate = self
        self.view.addSubview(searchView)
        searchView.searchBlock = {(searchBar) in
            print("block搜索:" + (searchBar.text ?? "nil"))

        }

    }
    

    func searchButtonClicked(_ searchBar:UISearchBar) -> Void {
          
           print("搜索:" + (searchBar.text ?? "nil"))

       }

}
